package com.woniuxy.depot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.woniuxy.depot.mapper.DepotMapper;
import com.woniuxy.depot.model.entity.Depot;
import com.woniuxy.depot.service.DepotService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DepotServiceImpl implements DepotService {
    @Resource
    private DepotMapper depotMapper;

    @Override
    public List<Depot> listForInStock() {
        QueryWrapper<Depot> wrapper = new QueryWrapper<>();
        wrapper.eq("state",1);
        return depotMapper.selectList(wrapper);
    }

    @Override
    public List<Depot> listForOutStock() {
        QueryWrapper<Depot> wrapper = new QueryWrapper<>();
        wrapper.between("state",1,2);
        return depotMapper.selectList(wrapper);
    }
}
